<template>
  <div class="app-container">
    <el-config-provider :locale="zhCn">
      <router-view v-if="isRouterAlive" />
    </el-config-provider>
  </div>
</template>

<script>
import { ElConfigProvider } from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'

export default {
  name: 'App',
  components: {
    ElConfigProvider
  },
  data() {
    return {
      isRouterAlive: true,
      zhCn
    }
  },
  provide() {
    return {
      reload: this.reload
    }
  },
  methods: {
    reload() {
      this.isRouterAlive = false
      this.$nextTick(() => {
        this.isRouterAlive = true
      })
    }
  }
}
</script>

<style>
.app-container {
  height: 100vh;
  width: 100%;
  overflow-x: hidden;
  max-width: 100vw;
}
</style> 